package com.pei.Servlet;


import com.pei.Service.Impl.userServiceImpl;
import com.pei.Service.userService;
import com.pei.entity.user;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;


/**
 * Created by dell on 2018/8/7.
 */
@WebServlet(name = "finduserByuidServlet")
public class finduserByuidServlet extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        userService service=new userServiceImpl();
        request.setCharacterEncoding("utf-8");
        user u= service.finduser(Integer.parseInt(request.getParameter("id")));
        request.setAttribute("u",u);
        if (Integer.parseInt(request.getParameter("idd"))==1){
            request.getRequestDispatcher("echarts23.jsp").forward(request,response);
        }
        if (Integer.parseInt(request.getParameter("idd"))==2){
            request.getRequestDispatcher("echarts215.jsp").forward(request,response);
        }
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doPost(request,response);
    }
}
